The prior art electromagnetic lock has a first seat embedded into an inner side of a doorframe and a second seat embedded at an upper edge of the doorframe. The first seat has a magnetic field seat which has a metal block therein. The metal block is retained with a plurality of lock studs which are arranged spacedly. One end of the lock stud is a heat protruded from a surface of a metal. The inner side of the second seat is assembled with a metal plate which is moveable as it is attracted. The metal plate faces to the first seat. The lateral side has two receiving grooves at positions corresponding to the two lock studs. A bottom of the receiving groove has a penetrating through hole. A buckling block is installed in the receiving groove. A buckling recess is formed in the buckling block facing to an opening of the lock stud. Two inner lateral walls of the buckling groove are inclined for matching to the lock studs. A screw penetrates through the bottom of the buckling groove of the buckling block and the through hole of the metal plate. A nut is fixed to a free end of the lock stud.
Although the prior art electromagnetic lock has the effect of locking, but the buckling groove of the buckling block in the second seat is buckled by the head of the lock stud and the buckling block is moved with the lock stud. When the doorframe is used for a long time, the buckling block will deform and the stud falls. The head of the lock stud is difficult to buckle the buckling groove of the buckling block so as to lose the function of locking.